package stud.aistar.entity;

import java.util.List;

/**
 * @author wangyu
 * @version 1.0
 * @description:本类用来演示:规定了返回的数据格式
 * @date 2019/10/08 0024
 */
public class ResultList <T>{
    private CodeStatus codeStatus;

    private boolean flag;//执行成功,true

    private String message;//描述一下当前正在执行的操作

    private List<T> data;//有可能是需要查询,查询出来的对象

    public ResultList() {
    }

    public ResultList(CodeStatus codeStatus, boolean flag, String message, List<T> data) {
        this.codeStatus = codeStatus;
        this.flag = flag;
        this.message = message;
        this.data = data;
    }

    public CodeStatus getCodeStatus() {
        return codeStatus;
    }

    public void setCodeStatus(CodeStatus codeStatus) {
        this.codeStatus = codeStatus;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResultList{" +
                "codeStatus=" + codeStatus +
                ", flag=" + flag +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
